package com.longge;

public class ModifyString {

    public String modifyString(String s) {

        char[] chars = s.toCharArray();
        int n = chars.length;
        for (int i = 0; i < n; i++) {
            if (chars[i] == '?') {
                for (char ch = 'a'; ch <= 'z'; ch++) {
                    if ((i>0&&ch==chars[i-1])||(i< n-1 &&chars[i+1]==ch)){
                        continue;
                    }
                    chars[i]=ch;
                }
            }
        }
        return new String(chars);


    }
}
